package com.yuda.operationcenter.service.impl;

import java.util.List;

import com.yuda.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import com.yuda.operationcenter.mapper.OperBannerMapper;
import com.yuda.operationcenter.domain.OperBanner;
import com.yuda.operationcenter.service.IOperBannerService;

/**
 * banner配置Service业务层处理
 *
 * @author wyn
 * @date 2021-04-12
 */
@Service
public class OperBannerServiceImpl implements IOperBannerService
{
    @Autowired
    private OperBannerMapper operBannerMapper;

    @Autowired
    private JdbcTemplate jdbcTemplate;

    /**
     * 查询banner配置
     *
     * @param id banner配置ID
     * @return banner配置
     */
    @Override
    public OperBanner selectOperBannerById(Long id)
    {
        return operBannerMapper.selectOperBannerById(id);
    }

    /**
     * 查询banner配置列表
     *
     * @param operBanner banner配置
     * @return banner配置
     */
    @Override
    public List<OperBanner> selectOperBannerList(OperBanner operBanner)
    {
        return operBannerMapper.selectOperBannerList(operBanner);
    }

    /**
     * 新增banner配置
     *
     * @param operBanner banner配置
     * @return 结果
     */
    @Override
    public int insertOperBanner(OperBanner operBanner)
    {
        operBanner.setCreateTime(DateUtils.getNowDate());
        return operBannerMapper.insertOperBanner(operBanner);
    }

    /**
     * 修改banner配置
     *
     * @param operBanner banner配置
     * @return 结果
     */
    @Override
    public int updateOperBanner(OperBanner operBanner)
    {
        operBanner.setUpdateTime(DateUtils.getNowDate());
        return operBannerMapper.updateOperBanner(operBanner);
    }

    @Override
    public int checkIsCanUpdateStatus(Long id) {
        return operBannerMapper.checkIsCanUpdateStatus(id);
    }

    @Override
    public int batchUpdateSellStatus(Long[] ids, int on_sell) {
        return operBannerMapper.batchUpdateSellStatus(ids,on_sell);
    }

    /**
     * 批量删除banner配置
     *
     * @param ids 需要删除的banner配置ID
     * @return 结果
     */
    @Override
    public int deleteOperBannerByIds(Long[] ids)
    {
        return operBannerMapper.deleteOperBannerByIds(ids);
    }

    /**
     * 删除banner配置信息
     *
     * @param id banner配置ID
     * @return 结果
     */
    @Override
    public int deleteOperBannerById(Long id)
    {
        return operBannerMapper.deleteOperBannerById(id);
    }













    @Override
    public int updateOrderNo(Long[] ids) {
        return operBannerMapper.updateOrderNo(ids);
    }


    @Override
    public List<OperBanner> selectById(int id) {
        return operBannerMapper.selectById(id);
    }
    @Override
    public List<OperBanner> selectByIds(long[] ids) {
        return operBannerMapper.selectByIds(ids);
    }




    @Override
    public int insertToBannerOn(Long[] ids) {
        return operBannerMapper.insertToBannerOn(ids);
    }

    @Override
    public List<OperBanner> selectByInnerLineUrl(String[] innerUrls) {
        return operBannerMapper.selectByInnerLineUrl(innerUrls);
    }
}
